# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=freeglut
pkgver=3.0.0
pkgrel=2
pkgdesc="Provides functionality for small OpenGL programs"
arch=(i686 x86_64)
url="http://freeglut.sourceforge.net/"
license=(MIT)
depends=(libxi libxrandr libgl)
makedepends=(mesa glu libxxf86vm cmake)
replaces=(glut)
provides=(glut)
conflicts=(glut)
source=(https://downloads.sourceforge.net/freeglut/${pkgname}-${pkgver}.tar.gz)
md5sums=('90c3ca4dd9d51cf32276bc5344ec9754')
sha1sums=('fca52242f9344627a30f11487ee42002e6b0dacd')

prepare() {
  mkdir build
}

build() {
  cd build
  cmake ../$pkgname-$pkgver -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
  install -Dm644 ../$pkgname-$pkgver/COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
